#include "comm.hpp"

int main() {
    Init shm;

    int fd = open(pipepath.c_str(), O_RDONLY);

    if (shm.shmid < 0) {
        cout << "have created" << endl;
        exit(1);
    }
    char* st = (char*)shmat(shm.shmid, nullptr, 0);
    char buffer[2] = {0};
    while(true)  {
        int n = read(fd, buffer, sizeof(buffer));
        if (n == 0) {
            cout << "client close" << endl;
            break;
        }
        cout << "server get: " << st << endl; 
        sleep(1);
    }
    shmdt(st);
}

